<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./../template/WorkspaceTemplate.xhtml">

    <ui:define name="top">

    </ui:define>

    <ui:define name="left">
    </ui:define>

    <ui:define name="right">

    </ui:define>

    <ui:define name="content">
        <style>
            .ui-state-highlight.ui-selected {
                color: blueviolet;
            }
        </style>
        <h2>Create Credit Group</h2>

        <h:form id="creditGroupForm" style="font-size: 85%">
            
            <p:panel id="panel1">
                <p:messages  />
                <br/>
                <h:outputText value="Basic Information" style="font-weight: bold; font-size: 110%"/>
                <p:separator/>
                <h:panelGrid columns="2" cellpadding="10">
                    <h:outputLabel value="Credit Group Title: " style="font-weight: bold"/>
                    <p:inputText value="#{cgManagerBean.cg.creditGroupTitle}" required="true" requiredMessage="Credit Group Title cannot be empty"/>
                    <h:outputLabel value="Extension Days: " style="font-weight: bold"/>
                    <p:inputText value="#{cgManagerBean.cg.extensionDays}" required="true" requiredMessage="Extension days cannot be empty"/>
                </h:panelGrid>
                <br/>
                <br/>
                <br/>
                <h:outputText value="Set Limit" style="font-weight: bold; font-size: 110%"/>
                <p:separator/>
                <h:panelGrid columns="2" cellpadding="10">
                    <h:outputLabel value="Credit Limit for Wholesales: " style="font-weight: bold"/>
                    <p:inputText value="#{cgManagerBean.cg.creditLimitForWs}" required="true" requiredMessage="Credit Limit for Wholesales cannot be empty"/>
                    <h:outputLabel value="Upgrade Limit for Wholesales: " style="font-weight: bold"/>
                    <p:inputText value="#{cgManagerBean.cg.upgradeLimitForWs}" required="true" requiredMessage="Upgrade Limit for Wholesales cannot be empty"/>
                    <h:outputText value=""/>
                    <h:outputText value=""/> 
                    <h:outputLabel value="Credit Limit for Direct Sales: " style="font-weight: bold"/>
                    <p:inputText value="#{cgManagerBean.cg.creditLimitForDs}" required="true" requiredMessage="Credit Limit for Direct Sales cannot be empty"/>
                    <h:outputLabel value="Upgrade Limit for Direct Sales: " style="font-weight: bold"/>
                    <p:inputText value="#{cgManagerBean.cg.upgradeLimitForDs}" required="true" requiredMessage="Upgrade Limit for Direct Sales cannot be empty"/>
                </h:panelGrid>
                <br/>
            </p:panel>
            <br/>
            <br/>
            <br/>
            <div align="right">
                <p:commandButton value="Create New Credit Group" image="ui-icon ui-icon-disk" action="#{cgManagerBean.createCreditGroup()}" update="creditGroupForm"/>
            </div>
            <br/>
            <br/>
        </h:form>
    </ui:define>

    <ui:define name="bottom">

    </ui:define>

</ui:composition>
